<?php

/**
 * Description of renderer
 *
 * @author Hardik
 */
class renderer {

    public function renderImage($params) {
        $data = json_decode($params[1], true);
        $out = out::__s();
        $out->finalOutput[] =  str_replace(array('{width}', '{height}', '{src}', '{class}'), array($data['height'], $data['width'], $data['src'], $data['class']), $params[0]);
    }

    public function renderForm($params) {
        $formParams = json_decode($params[1], true);
        $form = new orm($formParams);
        $form->renderForm();
    }

    /**
     * Recursive iteration to child registries
     * @param type $params 
     */
    public function doMain($params) {
        # get sub registry
        # and then recurse
        $registry_sequence = explode(",",$params[2]);
        
        foreach ($registry_sequence as $each_sequence) {
            $reg = new registry($each_sequence);
            $reg->process();
        }
    }

}

?>
